<html>
  <head>
  	<%= stylesheet_link_tag('tr8n/tr8n.css') %>
  	<%= stylesheet_link_tag('tr8n/keyboard_1_49.css') %>
    <%= csrf_meta_tags %>

	  <% if Tr8n::Config.enable_software_keyboard? %>
	    <script> 
	      VKI_default_layout = "<%=Tr8n::KeyboardMapping.current_1_49%>";
	    </script>     
	    <%=stylesheet_link_tag("tr8n/keyboard_1_49.css") -%>
	  <% end %>  

    <%= javascript_include_tag('tr8n/tr8n.js') %>

		<script type="text/javascript">
		  function resizeFrame() {
		    var height = Tr8n.element('tr8n_translator_content').offsetHeight + 10;
				Tr8n.postMessage({'subject': 'translator', 'action': 'resize', 'height': height}, '<%=params[:origin]%>');
		  }

		  function hideTranslator() {
		  	Tr8n.postMessage({'subject': 'translator', 'action': 'hide'}, '<%=params[:origin]%>');
		  }

		  function reloadOrigin() {
		  	Tr8n.postMessage({'subject': 'window', 'action': 'reload'}, '<%=params[:origin]%>');
		  }

	    Tr8n.Utils.addEvent(document, "keyup", function(event) {
	      if (event.keyCode == 27) {
					hideTranslator();
	      }
	    });
		</script>

  </head>	
  <body style="padding:0px;margin:0px;" onload="resizeFrame()">
  	<div id="tr8n_translator_content" class="tr8n_translator_content"> 
  	<%= tr8n_with_options_tag(:default_locale => Tr8n::Config.default_admin_locale, :admin => true) do %>
			<div class="hd">
			  <div class="supplemental">
			    <%=link_to_function(image_tag("tr8n/close.gif", :title=>trl("Close")), "hideTranslator()")%>
			  </div>
			  <%= tr8n_language_flag_tag(tr8n_current_language) %>
			  <%= trla("{language} Language Cases", nil, :language => tr8n_current_language.native_name) %>
			</div>
			<div class="bd" style="padding:5px;">
			  <%= render(:partial => @mode) %>
			</div>  
		<% end %>
	</div>
	</body>
</html>
